import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

const routes = [
  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView
  // },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
  {
    path: '/',
    name: 'loging',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import( /* webpackChunkName: "about" */ '../views/loging.vue')
  },
  {
    path: '/system',
    name: 'system',
    component: () => import('../views/system.vue'),
    children: [
      {
        path: '',
        name: 'butR',
        component: () => import('../components/system-butR.vue')
      },
      {
        path: 'butR',
        name: 'butRt',
        component: () => import('../components/system-butR.vue')
      },
      {
        path: 'butv',
        name: 'butvt',
        component: () => import('../components/system-butRv.vue')
      },
      {
        path: 'butd',
        name: 'butdt',
        component: () => import('../components/system-butRd.vue')
      }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router